home *** CD-ROM | disk | FTP | other *** search
/ New Perspectives on Computer Concepts / New Perspectives on Computer Concepts.iso / np2010c / page776.pag < prev    next >
Portable Network Graphic  |  2008-10-02  |  77KB  |  817x1045  |  8-bit (256 colors)
Labels: chat room | crt screen | hakham | monitor | plant | sky
OCR: 708 SECTION c CHAPTER 1.2 How does the code for the round getArea() method differ from the code for the rectangle getArea() method? The code for the getArea( method defined in the RoundPizza class asks users to key n or enter, the pizza's diameter. The method then divides the diameter by arrive the radius. The value for the radius is used in the TTr calculation 142 (radius radius) -for the area of a circle The getArea() method defined in the RectanglePizza class asks users to key in the length of i the pizza and then its width. This data S used in the cal- culation that multiplies length times width to produce the area of rectangu- FIGURE 12-38 lar pizza. Figure 12-38 illustrates the Java code for the getArea() methods The getArea) methods for The lines that begin with 11 are remarks punnd ...